﻿Array.prototype.IndexWhere = function IndexWhere(predicate)
{
	for (var i = 0; i < this.length; ++i)
	{
		if (predicate(this[i]))
			return i;
	}
	return -1;
}
